export interface Article {
  id: number;
  title: string;
  content: string;
  summary: string;
  cover?: string;
  author: {
    id: number;
    username: string;
    avatar?: string;
  };
  category: {
    id: number;
    name: string;
  };
  tags: Array<{
    id: number;
    name: string;
  }>;
  status: 'DRAFT' | 'PUBLISHED';
  viewCount: number;
  likeCount: number;
  commentCount: number;
  isLiked?: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface CreateArticleRequest {
  title: string;
  content: string;
  summary?: string;
  cover?: string;
  categoryId: number;
  tagIds: number[];
  status: 'DRAFT' | 'PUBLISHED';
}

export interface UpdateArticleRequest extends Partial<CreateArticleRequest> {
  id: number;
}

export interface GetArticlesParams {
  page?: number;
  size?: number;
  sort?: string;
  search?: string;
  categoryId?: number;
  tagId?: number;
  authorId?: number;
  status?: 'DRAFT' | 'PUBLISHED';
}

export interface PaginatedResponse<T> {
  content: T[];
  totalElements: number;
  totalPages: number;
  size: number;
  number: number;
  first: boolean;
  last: boolean;
  empty: boolean;
}

export interface ApiResponse<T> {
  code: number;
  message: string;
  data: T;
}

export interface Tag {
  id: number;
  name: string;
  articleCount?: number;
  createdAt: string;
  updatedAt: string;
}

export interface Category {
  id: number;
  name: string;
  description?: string;
  articleCount?: number;
  createdAt: string;
  updatedAt: string;
} 